package com.ynny.chapter14train.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class R {
    private Integer code;
    private String msg;
    private Object data;

    public  static R ok(Object data){
        return new R(200,"请求成功", data);
    }
    public  static R error(Object data){
        return new R(400,"请求失败",null);
    }

    public static R fail(int i, String 添加失败) {
        return new R(i,添加失败,null);
    }
}
